import Vue from 'vue'
import App from './App.vue'
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import store from'./store'
import router from './router/index'
import Axios from 'axios'
Axios.defaults.withCredentials=true;
import echarts from "echarts";
Vue.prototype.$echarts = echarts;
Vue.config.productionTip = false
// 引用： main.js 中引用
import dragVerify from 'vue-drag-verify-img-rotate'
Vue.use(dragVerify)
Vue.use(ElementUI)

Vue.filter('formatDate',function (str){
  let date=new Date(str)
  let y = date.getFullYear();
  let m = date.getMonth() + 1;
  m = m < 10 ? '0' + m : m;
  let d = date.getDate();
  d = d < 10 ? ('0' + d) : d;
  return y + '-' + m + '-' + d;
})

Vue.filter('formatTime',function (timeStr){
  let time=new Date(timeStr)
  let y = time.getFullYear();
  let m = time.getMonth() + 1;
  m = m < 10 ? '0' + m : m;
  let d = time.getDate();
  d = d < 10 ? ('0' + d) : d;
  let h=time.getHours();
  h=h<10?('0'+h):h;
  let min=time.getMinutes();
  min=min<10?('0'+min):min;

  return y + '-' + m + '-' + d+' '+h+':'+min;
})
if(localStorage.getItem("cityCode")==null){
  localStorage.setItem("cityCode",'0')
}
new Vue({
  render: h => h(App),
  store,router
}).$mount('#app')

